﻿using QuDao;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System;

namespace AdminUI.Pages.Home
{
    public partial class TenantMainModel : BaseModel
    {
        public void OnGet()
        {
            var day = SalesDailyBO.Instance.GetSummaryByDay(OnlineTID, DateTime.Now);
            var month = SalesDailyBO.Instance.GetSummaryByMonth(OnlineTID, DateTime.Now);

            ViewBag.NumOfDay = day.Item1;
            ViewBag.AmountOfDay = day.Item2;
            ViewBag.NumOfMonth = month.Item1;
            ViewBag.AmountOfMonth = month.Item2;
            ViewBag.DividedAmountOfMonth = month.Item3; //本月分账金额
            ViewBag.DeductionAmountOfMonth = month.Item4; //本月余额抵扣金额
            ViewBag.CostOfMonth = month.Item2 - month.Item3; //本月结算成本

            ViewBag.CashApplyOfMonth = CashApplyBO.Instance.GetSummaryByMonth(OnlineTID, DateTime.Now); //本月提现总金额

            var uc = UserBO.Instance.GetCountByType(OnlineTID);
            ViewBag.MANum = uc.Item1;
            ViewBag.MBNum = uc.Item2;
            ViewBag.MCNum = uc.Item3;
            ViewBag.MemberTotal = uc.Item4;

            ViewBag.OrderList = OrderBO.Instance.GetListByTID(OnlineTID, 1, 10);
            ViewBag.MemberList = UserBO.Instance.GetListByTID(OnlineTID, 1, 10);
        }
    }
}
